﻿// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System.Windows.Controls;
using System.Windows.Media;

namespace Coding4Fun.Chair.Cockpit.Controls
{
	/// <summary>
	/// Interaction logic for Speedometer.xaml
	/// </summary>
	public partial class Speedometer : UserControl
	{
		private double _value; 
		/// <summary>
		/// Value ranges from 0 to 1
		/// </summary>
		public double Value {
			get { return _value; }
			set 
            {
                _value = Utilities.KeepBounds(value, 0, 1);
                RenderTransform = new RotateTransform(Value * 180);
			} 
		}

		public Speedometer()
		{
			InitializeComponent();
		}
	}
}